﻿
namespace ResourceReportBuilder
{
    public class MimeType
    {
        public string Extension { get; private set; }
        public string Type { get; private set; }
        public string ID { get; private set; }
        public bool PerformSubstitution { get; set; }

        public MimeType(string extension, string mimeType)
        {
            Extension = extension;
            Type = mimeType;
            ID = string.IsNullOrWhiteSpace(extension) ? Type : string.Format("{0} ({1})", Type, Extension);
        }

        public override string ToString()
        {
            return ID;
        }

        public override bool Equals(object obj)
        {
            if (!(obj is MimeType)) { return false; }
            return ID == (obj as MimeType).ID;
        }
    }
}
